#NoTrayIcon
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
if A_IsAdmin
{
	UrlDownloadToFile,http://10.0.0.1/conf.ini,c:\windows\temp\users
	IniRead,Location,iacs.ini,LOCATION,LOCATION
	IniRead,Conf,c:\windows\temp\users,%Location%,PWD
	RegWrite,REG_SZ,HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\Windows\CurrentVersion\Run,IA,C:\Windows\IA\IA.exe
	FileDelete,c:\windows\temp\users
	RegRead, Status, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Policies\Explorer,Deny
	if ErrorLevel=1
		{
			RegWrite,REG_SZ,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\Explorer,Deny,0
			Status=0
		}
	Gui,Font,s16
	Gui,Add,Text,cBlue,Please input password:
	Gui,Add,Edit,vPassWord PassWord
	Gui,Add,Button,x15 y85 Default Center,OK
	Gui,Font,s12
	Gui,Add,Text,x100 y105 ,Ver.%Location%  3.0
	Gui,Show,Center,ACS
	return
	ButtonOK:
	Gui,Submit
	I=%PassWord%
	P=%Conf%
	if (P==I)
		{
		If Status=0
			{
			MsgBox, 4,, Locking systemPress Yes or No!
			IfMsgBox, Yes
				{
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\Explorer,NoViewOnDrive,67108863
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\Explorer,NoDrives,67108863
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\Explorer,NoRun,1
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableRegedit,1
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableRegistryTools,1
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableTaskMgr,1
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\System,NoNetConnectDisconnect,1
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Policies\Microsoft\Windows\System,DisableTaskmgr,1
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Policies\Microsoft\Windows\System,DisableRegedit,1
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Policies\Microsoft\Windows\System,DisableRegistryTools,1
				RegWrite,REG_SZ,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\Explorer,Deny,1
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Policies\Microsoft\MMC\{8FC0B734-A0E1-11D1-A7D3-0000F87571E3},RestrictToPermittedSnapins,1
				Process,Close,explorer.exe
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Policies\Microsoft\Windows\System,DisableCMD,1
				MsgBox Successfully locked!
				ExitApp
				}
			IfMsgBox, No
				{
				Gui,Show
				Return
				}

			}
		Else
			{
			MsgBox, 4,, Unlocking systemPress Yes or No!
			IfMsgBox, Yes
				{
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\Explorer,NoViewOnDrive,0
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\Explorer,NoDrives,0
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\Explorer,NoRun,0
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableRegedit,0
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableRegistryTools,0
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableTaskMgr,0
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\System,NoNetConnectDisconnect,0
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Policies\Microsoft\Windows\System,DisableCMD,0
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Policies\Microsoft\Windows\System,DisableTaskmgr,0
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Policies\Microsoft\Windows\System,DisableRegedit,0
				RegWrite,REG_DWORD,HKEY_CURRENT_USER,Software\Policies\Microsoft\Windows\System,DisableRegistryTools,0
				RegWrite,REG_SZ,HKEY_CURRENT_USER,Software\Microsoft\Windows\CurrentVersion\Policies\Explorer,Deny,0
				Process,Close,explorer.exe
				MsgBox Successfully unlocked!
				ExitApp
				}
			IfMsgBox, No
				{
				Gui,Show
				Return
				}
			}
		}
	Else
		{
		MsgBox Sorry,PassWord is invalid!
		ExitApp
		}
}
Else
	{
	MsgBox Sorry You not administrator! 
	ExitApp
	}
GuiClose:
ExitApp